import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/xiangqing',
    name: 'xiangqing',
    component: () => import('../views/xiangqing.vue')
  },

  {
    path: '/zhuce',
    name: 'zhuce',
    component: () => import('../views/zhuce.vue')
  },
  {
    path: '/denglu',
    name: 'denglu',
    component: () => import('../views/denglu.vue')
  },
  {
    path: '/mianban',
    name: 'mianban',
    component: () => import('../views/mianban.vue')
  },
  {
    path: '/zixun',
    name: 'zixun',
    component: () => import('../views/zixun.vue'),
    children:[
      {
        path: '/',
        name: 'tuijian',
        component: () => import('../views/zixunerji/tuijian.vue')
      },
      {
        path: '/dianshitai',
        name: 'dianshitai',
        component: () => import('../views/zixunerji/dianshitai.vue')
      },
      {
        path: '/guanzhu',
        name: 'guanzhu',  
        component: () => import('../views/zixunerji/guanzhu.vue'),
        children:[
          {
            path: '/guna',
            name: 'guna',
            component: () => import('../views/zixunerji/gun/guna.vue')
          },
           {
            path: '/gunb',
            name: 'gunb',
            component: () => import('../views/zixunerji/gun/gunb.vue')
          },
          {
            path: '/gunc',
            name: 'gunc',
            component: () => import('../views/zixunerji/gun/gunc.vue')
          }
        ]
      },
      {
        path: '/huodong',
        name: 'huodong',
        component: () => import('../views/zixunerji/huodong.vue')
      },
      {
        path: '/jcc',
        name: 'jcc',
        component: () => import('../views/zixunerji/jcc.vue')
      },
      {
        path: '/lola',
        name: 'lola',
        component: () => import('../views/zixunerji/lola.vue')
      },
      {
        path: '/lolm',
        name: 'lolm',
        component: () => import('../views/zixunerji/lolm.vue')
      },
      {
        path: '/saishi',
        name: 'saishi',
        component: () => import('../views/zixunerji/saishi.vue')
      },
      {
        path: '/shiping',
        name: 'shiping',
        component: () => import('../views/zixunerji/shiping.vue')
      },
      {
        path: '/tuijian',
        name: 'tuijian',
        component: () => import('../views/zixunerji/tuijian.vue')
      },
      {
        path: '/yunding',
        name: 'yunding',
        component: () => import('../views/zixunerji/yunding.vue')
      },
    ]

  },
  {
    path: '/haoyou',
    name: 'haoyou',
    component: () => import('../views/haoyou.vue'),
    children:[
      {
        path: '/hyxiaoxi',
        name: 'hyxiaoxi',
        component: () => import('../views/haoyouerji/hyxiaoxi.vue')
      },
      {
        path: '/hyhaoyou',
        name: 'hyhaoyou',
        component: () => import('../views/haoyouerji/hyhaoyou.vue')
      },
      {
        path: '/hyguanzhu',
        name: 'hyguanzhu',
        component: () => import('../views/haoyouerji/hyguanzhu.vue')
      },
    ]
  },
  {
    path: '/myq',
    name: 'myq',
    component: () => import('../views/myq.vue'),
    children:[
      {
        path: '/',
        name: 'mtuijian',
        component: () => import('../views/myqerji/mtuijian.vue')
      },
      {
        path: '/mguanzhu',
        name: 'mguanzhu',
        component: () => import('../views/myqerji/mguanzhu.vue')
      },
    ]
  },
  {
    path: '/shop',
    name: 'shop',
    component: () => import('../views/shop.vue')
  },
  {
    path: '/wode',
    name: 'wode',
    component: () => import('../views/wode.vue')
  },
  {
    path: '/',
    redirect:"/tuijian"
  },
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})
const originalPush = VueRouter. prototype.push
VueRouter. prototype.push = function push(location){
  return originalPush.call(this, location).catch(err => err)

}

export default router
